/* 
 * File:   Animation.h
 * Author: agu
 *
 * Created on 24 de mayo de 2014, 18:51
 */

#ifndef ANIMATION_H
#define	ANIMATION_H
#include <SDL2/SDL.h>
#include <string>
#include <vector>
#include <queue>
#include "client_Texture.h"

using std::string;
using std::vector;
using std::queue;

class Animation {
public:

    Animation(SDL_Renderer* renderer, const string path, int x, int y);
    ~Animation();
    void render();
    void render(int iniX, int iniY); //Dibuja desde iniX,iniy hasta la pos actual
    void getPosition(int& x, int& y);
    void updatePosition(int x, int y);
    void updateDirection(string codeDirection,string up, string down, string left, string right);

protected:
    void moveUp();
    void moveDown();
    void moveLeft();
    void moveRight();
    Texture texture;
    int currentFrame;
    //Walking animation
    int frames;
    vector<SDL_Rect> currentSprite;
    vector<SDL_Rect> spritesUp;
    vector<SDL_Rect> spritesDown;
    vector<SDL_Rect> spritesLeft;
    vector<SDL_Rect> spritesRight;
};

#endif	/* ANIMATION_H */

